package com.stefanini.pe.bbva.bp.in.report;

import net.sf.jasperreports.engine.JRChart;
import net.sf.jasperreports.engine.JRChartCustomizer;

import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot;
import org.jfree.chart.plot.Plot;

import java.awt.Color;
import java.awt.Font;

/**
 * @author Teodor Danciu (teodord@users.sourceforge.net)
 * @version $Id:BarChartCustomizer.java 2317 2008-08-27 09:06:42Z teodord $
 */
public class PieChartCustomizer implements JRChartCustomizer {
	
	public void customize(JFreeChart chart, JRChart jasperChart) {
		PiePlot plot = (PiePlot)chart.getPlot();
        plot.setLabelGenerator(new com.stefanini.pe.bbva.bp.in.report.CustomLabelGenerator());
        plot.setLabelBackgroundPaint(Color.WHITE);
        plot.setLabelOutlinePaint(Color.WHITE);
        plot.setLabelShadowPaint(Color.WHITE);	        
        plot.setBackgroundPaint(Color.white);
        plot.setCircular(true);		        
        plot.setInteriorGap(0.0);
        plot.setNoDataMessage("");
        //plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 7));
        plot.setIgnoreZeroValues(true);
        plot.setIgnoreNullValues(true);
        plot.setLegendItemShape(Plot.DEFAULT_LEGEND_ITEM_BOX);
        plot.setBaseSectionOutlinePaint(Color.LIGHT_GRAY);
		plot.setShadowPaint(Color.WHITE);		
	}
	
}
